<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function(){
	var currentPage=$("#currentPage").val()
	var totalPage=$("#totalPage").val();
	if(parseInt(currentPage)<=1){
		$("#upPage").attr("disabled","disabled");
	}
	if(parseInt(currentPage)>=parseInt(totalPage)){
		$("#downPage").attr("disabled","disabled");
	}
});

function changePage(){
	var nextPage=$("#toPage").val()
	var totalPage=$("#totalPage").val();
	var reg=/^([1-9]+[0-9]*)$/;
	if(!reg.exec(nextPage)){
		alert("请正确输入页数");
		$("#nextPage").val(1);
		return;
	}else {
	if(nextPage==''||parseInt(nextPage)==0){
		nextPage=1;
	}else if(parseInt(nextPage)>parseInt(totalPage)){
		nextPage=totalPage;
	}
	}
	page(nextPage);
}

function pageTo(val){
	page(val);
}
</script>
<input id="currentPage" type="hidden" value="${currentPage}">
<input id="totalPage" type="hidden" value="${pageCount}">
<table width="99%" >
		<tr>
			<td align="right">
				<span>共<font style="color: red; font-weight: bold;">${totalCount}</font>条，</span>
				<span>共<font style="color: red; font-weight: bold;">${pageCount}</font>页，</span>
				<span>每页10 条，</span>
			    <span>当前第 </span>
				<input id="toPage" value="${currentPage}" size="3"
					onkeydown="if(event.keyCode==13){changePage();}"
					style="width: 30px;height: 18px"
					type="text">
				<input  value="跳转" onclick="changePage()" title="跳转"
					class="button_02" accesskey="j" type="button">
				<span>页</span>
		       <input value="首页" title="首页" style="cursor: hand;" onclick="pageTo('1')"  class="button_02" accesskey="f" type="button">
				<input id="upPage" value="上页" onclick="pageTo('${currentPage-1}')"	title="上页" style="cursor: hand;" class="button_02" accesskey="p" type="button">
				<input id="downPage" value="下页" onclick="pageTo('${currentPage+1}')"	title="下页" class="button_02" style="cursor: hand;" accesskey="n" type="button">
				<input value="末页" onclick="pageTo('${pageCount}')" title="末页" style="cursor: hand;" class="button_02" accesskey="l" type="button">
			</td>
		</tr>
</table>


